import 'package:flutter/material.dart';
import 'Contants.dart';

class PageViewDemo extends StatelessWidget {
//  List<Widget> _bulidPageItem() {
//    List<FuliBean> list = FuliData.fuliList;
//    list.map((FuliBean fuli) {
//      return Stack(
//        children: <Widget>[
//          SizedBox(
//            child: Image.network(
//              fuli.url,
//              fit: BoxFit.cover,
//            ),
//          )
//        ],
//      );
//    }).toList();
//  }

  @override
  Widget build(BuildContext context) {
    return PageView.builder(
        pageSnapping: true,
        scrollDirection: Axis.vertical,
        itemCount: FuliData.fuliList.length,
        itemBuilder: (BuildContext context, int index) {
          FuliBean fuliBean = FuliData.fuliList[index];
          return Stack(children: <Widget>[
            SizedBox.expand(
              child: Image.network(
                fuliBean.url,
                fit: BoxFit.cover,
              ),
            ),
            Positioned(
                bottom: 8.0,
                left: 8.0,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Text(
                      fuliBean.who,
                      style: TextStyle(
                          fontSize: 20.0,
                          color: Colors.black,
                          fontWeight: FontWeight.bold),
                    ),
                    SizedBox(height: 10),
                    Text(
                      fuliBean.publishTime,
                      style: TextStyle(fontSize: 12.0, color: Colors.black45),
                    )
                  ],
                ))
          ]);
        });
  }
}
